/*
 *
 *      Copyright (c) 2018-2025, lengleng All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the pig4cloud.com developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: lengleng (wangiegie@gmail.com)
 *
 */

package com.pig4cloud.pig.admin.api.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
 * 省市区管理
 * </p>
 *
 * @author Jin
 * @since 2024-01-22
 */
@NoArgsConstructor
@AllArgsConstructor
@Builder(toBuilder = true)
@Data
@Schema(description="省市区")
@EqualsAndHashCode(callSuper = true)
public class SysArea extends Model<SysArea> {

	private static final long serialVersionUID = 1L;

	@TableId(value = "id", type = IdType.AUTO)
	@Schema(description = "id")
	private Long id;

	@Schema(description = "code")
	private String code;

	/**
	 * 名称
	 */
	@Schema(description = "名称")
	private String name;

	@Schema(description = "全名")
	private String fullName;

	@Schema(description = "拼音")
	private String pinyin;

	@Schema(description = "拼音首字母")
	private String pinyinPrefix;

	@Schema(description = "ext_code-原始")
	private String extCode;

	@Schema(description = "ext_name")
	private String extName;

	@Schema(description = "remark")
	private String remark;

	@Schema(description = "等级：1-省，2-市，3-区/县，4-街道/镇 5-社区/村")
	private Integer lv;

	@Schema(description = "父")
	private String parentCode;

	@Schema(description = "更新时间")
	private LocalDateTime updateTime;

	@Schema(description = "更新批次")
	private String batchNo;


	@Schema(description = "子集")
	@TableField(exist = false)
	private List<SysArea> children;

}
